Set mail-interactive if /usr/bin/mail is not executable and fakemail is chosen.
authorRob Browning <rlb@defaultvalue.org>
Sun, 9 Nov 2008 20:59:17 +0000 (12:59 -0800)
committerRob Browning <rlb@defaultvalue.org>
Sun, 9 Nov 2008 20:59:17 +0000 (12:59 -0800)
debian/changelog
debian/patches/avoid-fakemail-mail-loss.diff

index 95c0113b69ff802813341d864bd32c46a962578b..0ab32ac428ca6bf650ba8de2d97115b8430a3add 100644 (file)
@@ -5,7 +5,13 @@ emacs22 (22.2+2-5) unstable; urgency=low
     across all the relevant platforms. Thanks to Sven Joachim
     <svenjoac@gmx.de> for the fix. (closes: #503054)
 
- -- Rob Browning <rlb@defaultvalue.org>  Sun, 09 Nov 2008 10:40:43 -0800
+  * Set mail-interactive to t if /usr/bin/mail is not an executable and
+    fakemail is chosen.  This should still help avoid silent mail loss,
+    but won't signal an error if the mailer is never invoked.  Thanks to
+    Ralf Resack <horch_loeffelchen@yahoo.de> for proposing the
+    fix. (closes: #429059)
+
+ -- Rob Browning <rlb@defaultvalue.org>  Sun, 09 Nov 2008 12:05:33 -0800
 
 emacs22 (22.2+2-4) unstable; urgency=medium
 
index d8f2e9971543991aeb7854a4186e994a8fade327..b3f985753796c90e4fe60f03aa34b5b7caefece0 100644 (file)
 
   For now, Debian sets fakemail's MAIL_PROGRAM_NAME to /usr/bin/mail
   (which is the correct value for Debian systems) rather than
-  /bin/mail.  Debian also adjusts Emacs to test for the existence of
-  /usr/bin/mail before trying to run fakemail.  This is not an ideal
-  solution, but it should be an improvement.
+  /bin/mail.  Debian also adjusts Emacs to test whether or not
+  /usr/bin/mail exists and is executable.  If either of these tests
+  fail, then mail-interactive is set to t.  That should ensure that a
+  user will actually see an error if they attempt to use the broken
+  fakemail.
 
-  Note that Debian forces the value to /usr/bin/mail.  The build will
-  fail if any other value is specified.  This is done to ensure that
-  MAIL_PROGRAM_NAME isn't accidentally set to some other value during
-  the build process.  If this is undesirable for some reason, just
-  commment out avoid-fakemail-loss.diff in debian/patches/series.
+  Note that Debian actually forces the MAIL_PROGRAM_NAME value to
+  /usr/bin/mail.  The build will fail if any other value is specified.
+  This is done to ensure that MAIL_PROGRAM_NAME isn't accidentally set
+  to some other value during the build process.  If this is
+  undesirable for some reason, just comment out
+  avoid-fakemail-loss.diff in debian/patches/series.
   
 Index: sid/lib-src/fakemail.c
 ===================================================================
@@ -43,14 +46,16 @@ Index: sid/lisp/mail/feedmail.el
 ===================================================================
 --- sid.orig/lisp/mail/feedmail.el
 +++ sid/lisp/mail/feedmail.el
-@@ -1348,7 +1348,10 @@
+@@ -1348,7 +1348,12 @@
                              "/usr/lib/sendmail")
                             ((file-exists-p "/usr/ucblib/sendmail")
                              "/usr/ucblib/sendmail")
 -                           (t "fakemail"))
 +                           (t
 +                              (if (not (file-executable-p "/usr/bin/mail"))
-+                                  (error "/usr/bin/mail is not executable"))
++                                  (progn
++                                    (message "/usr/bin/mail is not an executable.  Setting mail-interactive to t.")
++                                    (setq mail-interactive t)))
 +                              "fakemail"))
                       nil errors-to nil "-oi" "-t")
                 ;; provide envelope "from" to sendmail; results will vary
@@ -59,14 +64,16 @@ Index: sid/lisp/mail/sendmail.el
 ===================================================================
 --- sid.orig/lisp/mail/sendmail.el
 +++ sid/lisp/mail/sendmail.el
-@@ -53,7 +53,10 @@
+@@ -53,7 +53,12 @@
      ((file-exists-p "/usr/sbin/sendmail") "/usr/sbin/sendmail")
      ((file-exists-p "/usr/lib/sendmail") "/usr/lib/sendmail")
      ((file-exists-p "/usr/ucblib/sendmail") "/usr/ucblib/sendmail")
 -    (t "fakemail"))                   ;In ../etc, to interface to /bin/mail.
 +    (t
 +     (if (not (file-executable-p "/usr/bin/mail"))
-+         (error "/usr/bin/mail is not executable"))
++         (progn
++           (message "/usr/bin/mail is not an executable.  Setting mail-interactive to t.")
++           (setq mail-interactive t)))
 +     "fakemail"))                     ;In ../etc, to interface to /bin/mail.
    "Program used to send messages."
    :group 'mail
@@ -75,16 +82,17 @@ Index: sid/lisp/gnus/message.el
 ===================================================================
 --- sid.orig/lisp/gnus/message.el
 +++ sid/lisp/gnus/message.el
-@@ -4026,7 +4026,12 @@
+@@ -4026,7 +4026,13 @@
                                     "/usr/lib/sendmail")
                                    ((file-exists-p "/usr/ucblib/sendmail")
                                     "/usr/ucblib/sendmail")
 -                                  (t "fakemail"))
 +                                  (t
-+                                     (if (not
-+                                          (file-executable-p "/usr/bin/mail"))
-+                                         (error
-+                                          "/usr/bin/mail is not executable"))
++                                     (if (not (file-executable-p
++                                               "/usr/bin/mail"))
++                                         (progn
++                                           (message "/usr/bin/mail is not an executable.  Setting mail-interactive to t.")
++                                           (setq mail-interactive t)))
 +                                     "fakemail"))
                              nil errbuf nil "-oi")
                        ;; Always specify who from,